﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace LotteCinema
{
    public partial class ThemVe : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if ((bool)Session["Solved"])
                {
                    DataTable veDaDat = (DataTable)Session["VeDaDat"];
                    for (int i = 0; i < veDaDat.Rows.Count; i++)
                        CProvider.Thuchienlenh("exec SP_THEM_VE '" + veDaDat.Rows[i][0].ToString() + "','" + veDaDat.Rows[i][1].ToString() + "','" + veDaDat.Rows[i][2].ToString() + "','" + veDaDat.Rows[i][3].ToString() + "',1");
                    Response.Write("Đặt vé thành công!");
                }
                else
                {
                    DataTable veDaDat = (DataTable)Session["VeDaDat"];
                    for (int i = 0; i < veDaDat.Rows.Count; i++)
                        CProvider.Thuchienlenh("exec aaa '" + veDaDat.Rows[i][0].ToString() + "','" + veDaDat.Rows[i][1].ToString() + "','" + veDaDat.Rows[i][2].ToString() + "','" + veDaDat.Rows[i][3].ToString() + "',1");
                }
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}